import buildMesh


def getNewXsecs(mesh):
  pass

def getAverageFlux(mesh,mtrl):
  total=[0,0] #fast, thermal fluxes times dx
  totaldx=0 #total cell widths
  for pin in mesh.pins: #loop over pins
    if mtrl in pin.mtrls:
      total[0]+=pin.width*pin.group[0].phi
      total[1]+=pin.width*pin.group[0]
  return total[0]/totaldx, total[1]/totaldx

def homogenize(mesh):
  for mtrl in mesh.mtrls:
    getAverageFlux(mesh,mtrl)
